import 'package:aqua_plunge/http/app_manager.dart';
import 'package:aqua_plunge/page/broadcasters_page.dart';
import 'package:aqua_plunge/page/home_normal_page.dart';
import 'package:flutter/material.dart';

class HomePgae extends StatefulWidget {
  const HomePgae({super.key});

  @override
  State<HomePgae> createState() => _HomPgaeState();
}

class _HomPgaeState extends State<HomePgae> with AutomaticKeepAliveClientMixin {

  bool? showAll = AppManager.showall();
  get _normalView =>  HomeNormalPage(seeAll: (){
    setState(() {
      showAll = true;
      AppManager.setshowallTrue();
    });
  });

  get _gridview => const BroadcasterPage();

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    super.build(context);
    return showAll == true ? _gridview : _normalView;
  }

  @override
  bool get wantKeepAlive => true;

}
